# Create your models here.
from django.db import models
from django.contrib.auth.models import User


# userinformation 主要用于存储一些拓展的用户内容，例如是否有认证
class UserInformation(models.Model):
    class Meta:
        db_table = "user_information"
        verbose_name = "用户信息"
        verbose_name_plural = verbose_name

    type = models.CharField(verbose_name="用户类型", max_length=20)
    available = models.BooleanField(default=True, verbose_name="可用")
    attestation = models.IntegerField(default=0, verbose_name="认证")
    attestation_inf = models.CharField(verbose_name="认证信息", max_length=30)
    auth = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name='用户', null=True, related_name="information")

    def __str__(self):
        return str(self.auth)
